import request from '@/utils/request'
// 获取员工列表
export const _getEmployeeList = (data) => {
  return request.get('/sys/user', {
    params: data
  })
}
// 批量导出员工 excel
export const _exportStaffExcel = () => {
  return request.get('/sys/user/export', {
    responseType: 'blob' // blob接收二进制文件流
  })
}
// 批量-下载导入员工模板
export const _getImportTemplate = () => {
  return request.get('/sys/user/import/template', {
    responseType: 'blob'
  })
}
// 批量-导入员工(上传excel)
export const _importStaffExcel = (data) => {
  return request.post('/sys/user/import', data)
}
// 删除员工
export const _deleteEmployee = (id) => {
  return request.delete(`/sys/user/${id}`)
}
// 新增员工
export const _addEmployee = (data) => {
  return request.post('/sys/user', data)
}
// 查看员工 获取员工基本信息
export const _getEmployeeBasic = (id) => {
  return request.get(`/sys/user/${id}`)
}
// 修改员工基本信息
export const _updateEmployee = (data) => {
  return request.put(`/sys/user/${data.id}`, data)
}
// 获取已启用 可分配的角色列表
export const _getAllotList = () => {
  return request.get('/sys/role/list/enabled')
}
// 分配 员工角色
export const _assignEmployee = (data) => {
  return request.put('/sys/user/assignRoles', data)
}
